//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-1999  Microsoft Corporation

Module Name:

rilmain.h

Abstract:


Notes:


--*/
/*
------------------------------------------------------------------------------
    Revision History
    Date                Author          Activity ID              Activity Headline
    2007-04-28          qinxuetao       WM600003778              Enable PPC to restore state after SIM reset
    2007-06-21          qinxuetao       WM600007125              Change STK and PB init procedure
    2007-08-14          qinxuetao       WM600009403              Modify SIM phonebook query thread(+WIND?)
------------------------------------------------------------------------------
*/

#pragma once

#include "rilsimtkit.h"     // Needed for CRilSTKTerminalProfile class

extern BOOL        g_cphschange;
extern const char *g_pcszCPHS;

#ifdef RIL_ENABLE_EONS
#include <eons.h>
extern EONS      g_eons;
extern EONSCache g_eonscache;
extern BOOL      g_eonschange;
#endif

//
#define MAX_DRIVERINIT_TIME    10000

// Globals
extern CRITICAL_SECTION g_csClosing;
extern HANDLE g_hCriticalErrorEvent;
extern HANDLE g_hNewDialOrHangupEvent;
extern DWORD g_dwReadyState;
extern DWORD g_dwRegStatus;
extern DWORD g_dwGPRSRegStatus;

extern DWORD g_dwLastCLIP;
extern DWORD g_dwLastCLIR;

extern CRilSTKTerminalProfile g_RilSTKTerminalProfile;

// Functions
HRESULT RILDrv_GetNextNotification(DWORD dwParam, RILDRVNOTIFICATION* lpRilDrvNotification);
HRESULT RILDrv_GetSerialPortStatistics(DWORD dwParam, RILSERIALPORTSTATS* lpSerialPortStats);
BOOL ClearCmdHandle(void* pItem, DWORD dwDummy);
CRilInstanceHandle* const ExtractHandle(const DWORD dwParam, BOOL bOverrideEmergency = FALSE);


void SignalCriticalError(DWORD dwEventId, DWORD dwLineNum, char *lpszFileName);
DWORD RIL_RestoreStateProc(LPVOID lpParameter);

